<template>
  <div>
    <router-view />
    <div class="course-detail" v-show="!flag">
      <LabelSelect />
      <CourseMain />
      <div class="webheart" style="min-height: 600px">
        <el-row :gutter="30">
          <el-col :span="6">
            <ClassifyList />
          </el-col>
          <el-col :span="18">
            <KnowledgeList />
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      flag: true,
    };
  },
  components: {
    LabelSelect: () => import("../components/LabelSelect.vue"),
    CourseMain: () => import("../../courseLibrary/courseDetail/CourseMain.vue"),
    ClassifyList: () =>
      import("../../courseLibrary/courseDetail/ClassifyList.vue"),
    KnowledgeList: () =>
      import("../../courseLibrary/courseDetail/KnowledgeList.vue"),
  },
  watch: {
    $route() {
      this.flag = this.$route.name.includes("knowdedge");
    },
  },
  mounted() {
    this.flag = this.$route.name.includes("knowdedge");
    this.openFullScreen1();
  },
  methods: {
    openFullScreen1() {
      const loading = this.$loading({
        lock: true,
        text: "Loading",
        spinner: "el-icon-loading",
        background: "rgba(255, 255, 255, 0.9)",
      });
      setTimeout(() => {
        // document.body.scrollTop = document.documentElement.scrollTop = 0;
        loading.close();
      }, 300);
    },
  },
};
</script>
<style scoped>
.course-detail {
  margin-bottom: 30px;
}
</style>